package com.swf.common.utils;

import java.awt.Color;
import java.util.Random;

public final class RandomUtils {
	/**
	 * 禁用默认构造器
	 */
	private RandomUtils() {
	}

	/**
	 * 产生一个随机的颜色
	 * 
	 * @return
	 */
	public static Color getRandomColor() {
		Random random = new Random();
		int red = random.nextInt(255);
		int green = random.nextInt(255);
		int blue = random.nextInt(255);
		return new Color(red, green, blue);
	}

	/**
	 * 产生一个从min到max之间的随机数
	 * 
	 * @param min
	 * @param max
	 * @return
	 */
	public static int getRandomBetween(int min, int max) {
		Random random = new Random();
		return random.nextInt(max - min) + min;
	}

}
